ensure invalid file names are reported for files that are not ignored
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Thu, 6 Mar 2025 13:48:46 +0000 (14:48 +0100)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Wed, 12 Mar 2025 14:12:50 +0000 (15:12 +0100)
we currently notify invalid file names for files that the sync engine
will not upload because they are ignored for other reasons (selective
sync for example)

let's first check if the file is ignored and only if the file would be
uploaded, we can check the file name validity

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/libsync/discovery.cpp

index 1ada8a5b59b78aa16788d6df4c55df7dae34cd96..2e4fa09da54ed36f1b398ab777e1a61fe9e9386d 100644 (file)
@@ -236,9 +236,7 @@ void ProcessDirectoryJob::process()
         // For windows, the hidden state is also discovered within the vio
         // local stat function.
         // Recall file shall not be ignored (#4420)
-        bool isHidden = e.localEntry.isHidden || (!f.first.isEmpty() && f.first[0] == '.' && f.first != QLatin1String(".sys.admin#recall#"));
-        if (handleExcluded(path._target, e, entries, isHidden))
-            continue;
+        const auto isHidden = e.localEntry.isHidden || (!f.first.isEmpty() && f.first[0] == '.' && f.first != QLatin1String(".sys.admin#recall#"));
 
         const auto isEncryptedFolderButE2eIsNotSetup = e.serverEntry.isValid() && e.serverEntry.isE2eEncrypted() &&
             _discoveryData->_account->e2e() && !_discoveryData->_account->e2e()->isInitialized();
@@ -252,6 +250,10 @@ void ProcessDirectoryJob::process()
             continue;
         }
 
+        if (handleExcluded(path._target, e, entries, isHidden)) {
+            continue;
+        }
+
         // HACK: Sometimes the serverEntry.etag does not correctly have its quotation marks amputated in the string.
         // We are once again making sure they are chopped off here, but we should really find the root cause for why
         // exactly they are not being lobbed off at any of the prior points of processing.